//
//  DataModel.m
//  DebugDemo
//
//  Created by XFB on 2019/1/7.
//  Copyright © 2019年 ZhouCheng. All rights reserved.
//

#import "DataModel.h"

@implementation DataModel

/**
 获得数据,成功失败
 
 @param success 成功
 @param failure 失败
 */
- (void)getDataSuccess:(SuccessBlock)success
               failure:(FailureBlock)failure
{
    NSArray *result = @[
                        @{
                            @"city" : @"北京",
                            @"code" : @"10000",
                            },
                        @{
                            @"city" : @"上海",
                            @"code" : @"20000",
                            },
                        @{
                            @"city" : @"广州",
                            @"code" : @"30000",
                            },
                        ];
    
    if (result.count > 0) {
        success(@{@"data":result});
    } else {
        failure(@{@"error":@"NO DATA"});
    }
    
}


@end
